<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Xsy
  Date: 2020/7/12
  Time: 22:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta name="viewport" content="width=device-width" initial-scale="1.0">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.css">
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.12.4.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap.js"></script>
</head>
<body>
<div class="panel panel-default">
    <div class="panel-heading">
        <h4>用户管理</h4>
    </div>
    <div class="panel-body">
        <table class="table table-striped table-bordered">
            <thead>
            <tr>
                <th>id</th>
                <th>昵称</th>
                <th>邮箱</th>
                <th>状态</th>
                <th>激活码</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach var="u" items="${requestScope.pageInfo.list}">
                <tr>
                    <td>${u.userId}</td>
                    <td>${u.nickname}</td>
                    <td>${u.email}</td>
                    <td>${u.status == 1 ? "正常":"锁定"}</td>
                    <td>${u.code}</td>
                    <td>
                        <a href="${pageContext.request.contextPath}/back/user/updateStatus.do?userId=${u.userId}&status=${u.status == 1 ?-1:1}" class="btn btn-warning">修改状态</a>
                    </td>
                </tr>
            </c:forEach>

            </tbody>
        </table>

        <ul class="pagination">
            <li ${pageInfo.isFirstPage?"class='disabled'":""}>
                <a href="${pageInfo.isFirstPage?'javascript:void(0)':'${pageContext.request.contextPath}/back/user/show.do?pageNum=1&pageSize=${pageInfo.pageSize}'}" aria-label="Previous" >
                    <span aria-hidden="true">&laquo;</span>
                </a>
            </li>
            <c:forEach var="i" items="${requestScope.pageInfo.navigatepageNums}">
                <li><a href="${pageContext.request.contextPath}/back/user/show.do?pageNum=${pageInfo.pageNum}&pageSize=${pageInfo.pageSize}">${i}</a></li>
            </c:forEach>
            <li ${pageInfo.isLastPage?"class='disabled'":""}>
                <a href="${pageInfo.isLastPage?'javascript:void(0)':'${pageContext.request.contextPath}/back/user/show.do?pageNum=${pageInfo.pageNum+1}&pageSize=${pageInfo.pageSize}'}" aria-label="Previous" >
                    <span aria-hidden="true">&laquo;</span>
                </a>
            </li>
        </ul>
    </div>
    <div class="panel-footer"></div>
</div>
<script>

</script>
</body>
</html>
